const http = require('http');
const staticServer = require('./02-staticservice')
const path = require('path');

/* 创建服务器 */
http.createServer((req,res) => {

    if(req.url === '/favicon.ico'){
        res.end();
        return
    }
    
    staticServer(req,res,path.join(__dirname,'static'));
    


}).listen(8080,() => {
    console.log('running....')
})